<?php
class Cart extends AppModel {
	var $name = 'Cart';
	var $displayField = 'name';
	var $validate = array(
		'name' => array(
			'notempty' => array(
				'rule' => array('notempty'),
				//'message' => 'Your custom message here',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'upload_id' => array(
			'numeric' => array(
				'rule' => array('numeric'),
				//'message' => 'Your custom message here',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
	);
	//The Associations below have been created with all possible keys, those that are not needed can be removed

	var $hasAndBelongsToMany = array(
		'Category' =>
			array( 	'className' => 'Category',
				'joinTable' => 'carts_categories',
				'foreignKey' => 'carts_id',
				'associationForeignKey' => 'category_id',
				'order' => 'Category.name',
				'unique' => false
		),
		'User' =>
		array( 	'className' => 'User',
						'joinTable' => 'carts_users',
						'foreignKey' => 'carts_id',
						'associationForeignKey' => 'user_id',
						'order' => 'User.id',
						'unique' => false
		)	
	);
	
	var $belongsTo = array(
		'Upload' => array(
			'className' => 'Upload',
			'foreignKey' => 'upload_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		)
	);
	


// 	var $hasMany = array(
// 		'CartsCategory' => array(
// 			'className' => 'CartsCategory',
// 			'foreignKey' => 'carts_id',
// 			'dependent' => false,
// 			'conditions' => '',
// 			'fields' => '',
// 			'order' => '',
// 			'limit' => '',
// 			'offset' => '',
// 			'exclusive' => '',
// 			'finderQuery' => '',
// 			'counterQuery' => ''
// 		),
// 		'CartsUser' => array(
// 			'className' => 'CartsUser',
// 			'foreignKey' => 'cart_id',
// 			'dependent' => false,
// 			'conditions' => '',
// 			'fields' => '',
// 			'order' => '',
// 			'limit' => '',
// 			'offset' => '',
// 			'exclusive' => '',
// 			'finderQuery' => '',
// 			'counterQuery' => ''
// 		)
// 	);

}
